package org.icy.core.installation.strategy;

import java.io.File;
import java.util.Collection;

import org.icy.core.installation.InstallStrategy;
import org.icy.core.installation.InstallWorker;
import org.icy.utils.FileUtils;
import org.icy.utils.PathUtils;

public class CoreModulesInstallStrategy implements InstallStrategy {

	@Override
	public void install() throws Exception {
		File moduleFolder = new File(PathUtils.getAbsolutePath("/installation/modules/"));
		Collection<File> moduleFiles = FileUtils.listFiles(moduleFolder, "zip");
		for(File f: moduleFiles) {
			InstallWorker worker = new InstallWorker();
			worker.install(f);
		}
	}

	@Override
	public void setParam(Object param) {}

}
